package us.kg.kotoriforest.springmvc.restful.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import us.kg.kotoriforest.springmvc.restful.vo.request.EmployeeAddVo;
import us.kg.kotoriforest.springmvc.restful.vo.request.EmployeeUpdateVo;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author Kotori rotroutine@163.com
 * @since 2025/2/4
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
public class Employee {
    private Long id;
    private String name;
    private Integer age;
    private String email;
    private String gender;
    private String address;
    private BigDecimal salary;
    private Date birthday;

    public Employee(EmployeeAddVo vo) {
        this.id = null;
        this.name = vo.getName();
        this.age = vo.getAge();
        this.email = vo.getEmail();
        this.gender = vo.getGender();
        this.address = vo.getAddress();
        this.salary = vo.getSalary();

        // BeanUtils.copyProperties(vo, this);
    }

    public Employee(EmployeeUpdateVo vo) {
        this.id = vo.getId();
        this.name = vo.getName();
        this.age = vo.getAge();
        this.email = vo.getEmail();
        this.gender = vo.getGender();
        this.address = vo.getAddress();
        this.salary = vo.getSalary();

        // BeanUtils.copyProperties(vo, this);
    }
}
